package com.shop.service.impl;

import java.util.List;

import com.shop.bean.User;
import com.shop.dao.IUserDao;
import com.shop.dao.impl.UserDaoImpl;
import com.shop.service.IUserService;

/** 
 * @className: UserServiceImpl.java
 * @classDescription: 
 * @function: 
 * @author: Wentasy
 * @createTime: 2012-11-1 下午07:19:49
 * @modifyTime: 
 * @modifyReason: 
 * @since: JDK 1.6
 */
public class UserServiceImpl implements IUserService{
	
	private IUserDao userDao = null;
	public int createUser(User user) throws Exception {
		userDao = new UserDaoImpl();	
		return this.userDao.createUser(user); 
	}

	public int deleteUserById(long userId) throws Exception {
		return this.userDao.deleteUserById(userId);
	}

	public List<User> queryAllUser() throws Exception {
		
		return this.userDao.queryAllUser();
	}

	public List<User> queryAllUser(int startPage, int pageSize)
			throws Exception {
		return this.userDao.queryAllUser(startPage, pageSize);
	}

	public User queryUserById(long userId) throws Exception {
		
		return this.userDao.queryUserById(userId);
	}

	public User queryUserByName(String name) throws Exception {
		return this.userDao.queryUserByName(name);
	}

	public int updateOrder(User user) throws Exception {
		return this.userDao.updateOrder(user);
	}

}
